/*
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-01-29 12:45:20
 * @Description  : 部门相关类型
 */

import type { PageRes } from './commom'

export interface DepartmentReq {
  page?: number
  pageSize?: number
  name?: string
  pid?: string
}

// Department返回实体
export interface DepartmentRes {
  id: string
  pid: string
  name: string
  desc: string
  sort: number
  label: string
  system: number
  isVisible: number
  sizeMax: string
  sizeUse: string
  createTime: string
  isLeaf: number | boolean
  isUserLeaf: number | boolean
  copDepartments: {
    linkDepId: string
  }[]
}

// 分页Department返回实体
export type DepartmentPageRes = PageRes<DepartmentRes>

// 部门添加请求实体类型
export interface DepartmentCreateReq {
  name: string
  pid: string
  sizeMax: string
  cooperatDepIds: string[]
}

// 部门修改请求实体
export interface DepartmentUpdateReq extends DepartmentCreateReq {
  depId?: string
}

export interface DepartmentSetSizeMax {
  depIds: string[]
  sizeMax: string
}
